#ifndef _FIB_HEAP_H_
#define _FIB_HEAP_H_

typedef struct FHE {
	int key;
	int degree;
	int marked;
	FHE *parent, *child;
	FHE *left,*right;
};

typedef struct FH {
	int n;
	FHE *min;
};

FH *make_fib_heap();
FHE *make_fib_heap_elem(int);
void fib_heap_insert(FH**,FHE**);
FHE *find_min(FH*);
FH *fib_heap_union(FH*,FH*);
FHE *fib_heap_extract_min(FH**);
void consolidate(FH**);
void fib_heap_link(FH**,FHE**,FHE**);
int upper_bound(FH*);
void set_as_child_helper(FH**,FHE**);
void cut(FH**,FHE**,FHE**);
void cascading_cut(FH**,FHE**);
void fib_heap_decrease_key(FH**,FHE**,int);
void fib_heap_delete(FH**,FHE**);

#endif